class Word(str):
    def __new__(cls, word): #对于不可变类型str,不能用init方法重写，需要用new方法来定义一些初始化操作
        if ' ' in word:
            word = word.replace(' ', '')
        return str.__new__(cls, word)
    def __lt__(self, other):
        return len(self) < len(other)
    def __gt__(self, other):
        return len(self) > len(other)
    def __ge__(self, other):
        return len(self) >= len(other)
    def __le__(self, other):
        return len(self) <= len(other)
